Skip to content

fix: axios does not preserve symbols in its config#916

Merged
susnux merged 3 commits intomainfrom
fix/axios
Apr 15, 2026
Merged

fix: axios does not preserve symbols in its config#916
susnux merged 3 commits intomainfrom
fix/axios

Conversation

@susnux
Copy link
Copy Markdown
Contributor

@susnux susnux commented Apr 14, 2026

It seems Axios does not preserve entries in the request config which have a symbol-key.
So this refactors the code (see commit 3) to use string keys instead.

Commit 1 migrates the unit tests to proper tests without mocking axios.
So they are more like e2e tests (meaning we really also test integration with Axios).
Moreover I migrated them to use vitest browser mode as this library never runs in Node env but is intended for browsers.

Commit 2 only fixes the filesystem structure, we either use tests, __tests__ or next-to-code test files but never test folder.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.30%. Comparing base (fe19736) to head (6a4c5c5).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lib/interceptors/not-logged-in.ts 60.00% 2 Missing ⚠️
lib/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #916      +/-   ##
==========================================
- Coverage   91.80%   87.30%   -4.51%     
==========================================
  Files           5        5              
  Lines          61       63       +2     
  Branches       19       19              
==========================================
- Hits           56       55       -1     
- Misses          5        8       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@susnux susnux marked this pull request as ready for review April 15, 2026 12:21
Comment thread lib/interceptors/csrf-token.ts Outdated
susnux added 3 commits April 15, 2026 18:22
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Axios (somehow) does not preserve entries in the config,
which have an symbol as their key.
So this migrates the internally used symbols to string-keys.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux merged commit c35a05c into main Apr 15, 2026
7 of 9 checks passed
@susnux susnux deleted the fix/axios branch April 15, 2026 20:05
@susnux susnux mentioned this pull request Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants